import request from '@/utils/request.ts'
import axios from '../../utils/request';
import { IReportListParams, ILoadFileParams } from '@/types/report'
enum API {
    GETREPORTLIST_URL = '/api/v1/mci/searchpage',//获取报告列表数据
    LOADFILE_URL = '/api/v1/mci/getreport',//生成测评报告
    UPLOAD_URL = '/api/v1/mci/upload',
    GET_PDF_FILE_NAME_URL = '/api/v1/mci/get-report-name'//获取pdf文件名
}
//获取报告列表数据
export function getReportList(data: IReportListParams) {
    return request({
        url: API.GETREPORTLIST_URL,
        method: 'post',
        data
    })
}
//生成测评报告
export function getPdfData(data: ILoadFileParams) {
    return request({
        url: API.LOADFILE_URL,
        method: 'post',
        // responseType: 'blob',
        data
    })
}
//上传测评报告
export function upLoadFile(data:any){
    return request({
        url: API.UPLOAD_URL,
        method:'post',
        data
    })
}
//获取pdf文件名
export const getPdfFileName = (taskId: any) => {
	return axios({
		url: API.GET_PDF_FILE_NAME_URL + `?taskId=${taskId}`,
		method:'get',
	})
}
